#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File    : _default.py
# @Author  : Alisen
# @Date    : 2021-04-20
# @Desc    : 


class Config(object):  # 默认配置
    DEBUG = True

    ENV_NAME = 'default'

    TIMEOUT_OF_PER_ACTION = 3

    # 采集数据库
    MYSQL_HOST: str = "183.60.248.102"
    MYSQL_PORT: int = 4122
    MYSQL_PASSWORD = 'nfWWfpRqqPMuV'
    MYSQL_USER = 'crawler'
    MYSQL_DATABASE = 'xhs_crawler_test'

    # # 业务数据库
    # PRODUCT_MYSQL_HOST = "47.112.188.43"
    # PRODUCT_MYSQL_PORT = 3306
    # PRODUCT_MYSQL_USER = "xiaohongshu"
    # PRODUCT_MYSQL_PASSWORD = "xhs2020!@QW"
    # PRODUCT_DATABASE = "xiaohongshu"
    MYSQL_SDW_HOST: str = '172.18.24.209'
    MYSQL_SDW_PORT: int = 33060
    MYSQL_SDW_PASSWORD = 'GcwqQDZe14IO5PPyI'
    MYSQL_SDW_USER = 'sandworm_crawler'
    MYSQL_SDW_DATABASE = 'db_syzh_sandworm_crawler'

    # 表名
    TABLE_NOTE_V2 = 't_xhs_app_crawler_note_v3'
    TABLE_JOB_HISTORY = 't_xhs_job_history_v3'
    TABLE_JOB_RUSH_LIKE = 't_xhs_job_rush_like_v3'
    TABLE_KEYWORDS = 't_xhs_keywords_v3'
    TABLE_DEVICE_ACCOUNT_ALL = 't_xhs_device_account_all'
    TABLE_JOB_GROWUP = 't_xhs_job_growup'
    TABLE_JOB_SEARCH = 't_xhs_job_search_v3'

    AWS_PROXY_ID = 'ss-dev-aws'
    TRANS_PROXY_FROM = 'sy'

    FLASK_ENV = 'development'
    FLASK_DEBUG = True

    # 测试key
    ROBOT_KEY = '8cf1cd80-d289-420f-b222-aaa88f239aa7'
    DOUYIN_ROBOT_KEY = '8cf1cd80-d289-420f-b222-aaa88f239aa7'

    REDIS_SINGLE = "172.18.24.205|16379||0|5"
    REDIS_CLUSTER = [{"host": "172.18.24.205", "port": 6310}, {"host": "172.18.24.205", "port": 6311},
                     {"host": "172.18.24.206", "port": 6310}, {"host": "172.18.24.206", "port": 6311},
                     {"host": "172.18.24.207", "port": 6310}, {"host": "172.18.24.207", "port": 6311}]
    HK_REDIS_CLUSTER = REDIS_CLUSTER

    TENDIS_CLUSTER = "172.18.24.212|51002||0|5"

    BOOTSTRAP_SERVERS = '172.18.24.205:9092,172.18.24.206:9092,172.18.24.207:9092'
    BOOTSTRAP_SERVERS_2 = '172.18.24.205:9092,172.18.24.206:9092,172.18.24.207:9092'
    # BOOTSTRAP_SERVERS = '172.18.6.202:29092,172.18.24.205:9092' # 包含异常的地址

    SEKIRO_URL = 'http://172.18.24.219:32652/business-demo/invoke'
    # SEKIRO_URL = 'http://127.0.0.1:5620/business-demo/invoke'
    SEKIRO_DEVICES_URL = 'http://172.18.24.219:32652/business-demo/clientQueue?group=translate-google'

    # 小红书业务侧接口地址
    PROD_URL = 'https://xhstool-sit.datatell.com.cn/api'

    # SEO项目清单
    SEO_PROJECT_LIST = ['xhs', 'douyin', 'pg', 'facebook']

    # Lotus接口地址
    LOTUS_URL = 'http://127.0.0.1:8181/lotus'

    WTF_CSRF_ENABLED = False

    SPLASH_URL = 'http://172.18.24.213:32671'

    TM_DETAIL_URL = 'http://120.31.140.130:30652'

    SKYWALKING_URL = 'skywalking-oap.monitoring.svc:11800'

    ES_URL = ['https://es-banyan.datastory.com.cn/']
    ES_USERNAME = 'whale'
    ES_PWD = 'UXt5YjiAaCPOGn5x'
    FS_ES_URL = ['n1.fullpond.es.syzh:19200', 'n2.fullpond.es.syzh:19200']

    WHALE_ES_URL = ["n1.whale.es.syzh:19202", 'n2.whale.es.syzh:19202']
    WHALE_ES_USER = 'whale'
    WHALE_ES_PWD = 'UXt5YjiAaCPOGn5x'

    SANDWORM_MYSQL_HOST = 'syzh.mysql.proxy'
    SANDWORM_MYSQL_PORT = 3316
    SANDWORM_MYSQL_USER = 'sandworm-read'
    SANDWORM_MYSQL_PASSWORD = 'TJROVOtnsZV7x7GJ'
    SANDWORM_MYSQL_DATABASE = 'db_syzh_sandworm_v2'
    SSH_HOST = 'mnet.datastory.com.cn'
    SSH_PORT = 56000
    SSH_USER = 'jinghe'
    SSH_PASSWORD = 'Sy-12345'

    MONGO_DB = "mongodb://sandworm:4VtyWXW2HGDVLLu@172.18.24.205:27017,172.18.24.206:27017,172.18.24.207:27017/?replicaSet=alpsdev"

    CUSTOM_SPIDER_API_URL = 'http://127.0.0.1:8081/custom'

    # RHINO_API_HOST = 'http://api.rhino.datatub.com'
    RHINO_API_HOST = 'https://api.hermes.ds-int.cn/newbee/legacy'

    # SEKIRO_URL = 'http://172.18.24.219:32652/business-demo/invoke'
    # get attribute
    def __getitem__(self, key):
        return self.__getattribute__(key)
